package operation;

import book.BookList;

import java.util.Scanner;

public class ReturnOperation implements IOperation{

    @Override
    public void work( BookList bookList) {
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入你要归还的图书：");
        String name=scanner.nextLine();

        int cin= bookList.getUsedSize();

        for (int i=0;i<cin;i++){
            if (bookList.getBook(i).equals(name)) {
                bookList.getBook(i).setBorrowed(false);
                System.out.println("归还阅成功");
                return;

            }
        }
        System.out.println("归还图书");
    }
}
